package com.lzw.service.impl.superAdmin;

import com.lzw.mapper.superAdmin.SuperLoginMapper;
import com.lzw.service.superAdmin.SuperLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class SuperLoginServiceImpl implements SuperLoginService {

    @Autowired
    private SuperLoginMapper superLoginMapper;

    @Override
    public boolean login(String username, String password) {
        return superLoginMapper.checkCredentials(username, password) != null;
    }

    @Override
    public Map<String, Object> getAdmin(String username, String password) {
        return superLoginMapper.getAdmin(username, password);
    }

    @Override
    public Map<String, Object> getAdminById(Integer adminId) {
        return superLoginMapper.getAdminById(adminId);
    }

    @Override
    public boolean updateAdmin(Integer adminId, String name, String phone, String email) {
        return superLoginMapper.updateAdmin(adminId, name, phone,email) > 0;
    }
}
